package tmproject.hlhj.fhp.cartrans.activitys

import kotlinx.android.synthetic.main.aty_review_detail.*
import tmproject.hlhj.fhp.cartrans.BaseAty
import tmproject.hlhj.fhp.cartrans.IView.ClassDetailView
import tmproject.hlhj.fhp.cartrans.R
import tmproject.hlhj.fhp.cartrans.javaBean.ClassDetailBean
import tmproject.hlhj.fhp.cartrans.javaBean.SaveClassBean
import tmproject.hlhj.fhp.cartrans.presenter.ClassDetailPresenter
import tmproject.hlhj.fhp.cartrans.utils.SpHelper
import tmproject.hlhj.fhp.cartrans.utils.WebUtils

class ReviewDetaiAty :BaseAty<ClassDetailView,ClassDetailPresenter>(), ClassDetailView {
    override fun setDetailData(classDetailBean: ClassDetailBean) {
        WebUtils.loadUrl(webView,classDetailBean.data.content)
    }


    override fun setSaveClassResult(saveClassBean: SaveClassBean) {
    }

    override fun initView() {
        WebUtils.initWeb(webView,this)

    }

    override fun logicStart() {
        presenter?.getClassDetail(intent.getStringExtra("id").toInt(),SpHelper.getToken(this),this)
    }

    override fun setListener() {
        btExit.setOnClickListener {
            finish()
        }
    }

    override fun getContentId(): Int {
        return R.layout.aty_review_detail
    }

    override fun bindView(): ClassDetailView {
        return this
    }

    override fun createPresenter(): ClassDetailPresenter {
        return ClassDetailPresenter()
    }
}